package com.zyj.springboothapim.controller;

import com.zyj.springboothapim.bean.Complain;
import com.zyj.springboothapim.service.ComplainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
//这个是默认json接收和发送@RestController
@RequestMapping("/Complain")
public class ComplainController
{
    ComplainService complainService;

    @Autowired
    public void setComplainService(ComplainService complainService)
    {
        this.complainService = complainService;
    }

    //接受路由网址的申请
    @RequestMapping(value = "/selectComplain" ,method = {RequestMethod.POST,RequestMethod.GET})
    @ResponseBody
    public List<Complain> selectAdmin(){
        System.out.println("/Complain/selectComplain");
        return complainService.selectComplaint();
    }


}
